package PAT;

import java.util.Scanner;

public class PAT1019 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int digit = scanner.nextInt();
        StringBuilder pp = parse(n,digit);
        String p = pp.toString();
        String sp = pp.reverse().toString();
        if(sp.equals(p)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        for (int i = 0; i < sp.length(); i++) {
            System.out.print(sp.charAt(i));
            if(i<sp.length()-1){
                System.out.print(" ");
            }
        }
    }

    private static StringBuilder parse(int n, int digit) {
        StringBuilder sb = new StringBuilder();
        while (n>0){
            sb.append(n%digit);
            n/=digit;
        }
        return sb;
    }
}
